#!/usr/bin/env python
# encoding: utf-8
"""
forms.py

Created by reedhong on 2011-10-18.
Copyright (c) 2011 __MyCompanyName__. All rights reserved.
"""

#coding=utf-8

from django import forms
from conversation.models import Conversation

    
class ConversationForm(forms.Form):
    content = forms.CharField(widget=forms.Textarea)
    
    warn = ""
        
    def __init__(self, request=None, *args, **kwargs):
        super(ConversationForm, self).__init__(*args, **kwargs)
        
    def save(self, user, vote):
        conversation = Conversation(user=user, vote=vote, content=self.cleaned_data['content'])
        conversation.save()
        return conversation